package com.codechenxi.study.controller;

import com.codechenxi.study.service.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author codechenxi
 * @description
 * @since 2025-07-02 21:40
 */

@RestController
public class DeclarativeAIServiceController {

    @Resource
    private ChatAssistant chatAssistantQwen;

    // http://localhost:9003/langchain4j/boot/declarative
    @GetMapping(value = "/langchain4j/boot/declarative")
    public String declarative(@RequestParam(value = "prompt", defaultValue = "你是谁") String prompt)
    {
        return chatAssistantQwen.chat(prompt);
    }
}
